unit frmOrcamentosProcMateriaisUnt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Grids, DBGrids;

type
  TfrmOrcamentosProcMateriais = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    BitBtnProcurar: TBitBtn;
    DBGrid1: TDBGrid;
    procedure BitBtnProcurarClick(Sender: TObject);
    procedure DBGrid1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmOrcamentosProcMateriais: TfrmOrcamentosProcMateriais;

implementation

uses DMDadosUnt, frmOrcamentosUnt;

{$R *.dfm}

procedure TfrmOrcamentosProcMateriais.BitBtnProcurarClick(Sender: TObject);
begin
  with DMDados do
    begin
      cdsConsMateriais.Close;
      cdsConsMateriais.Params[0].AsString := UpperCase(Edit1.Text) + '%';
      cdsConsMateriais.Open;

    end;
end;

procedure TfrmOrcamentosProcMateriais.DBGrid1DblClick(Sender: TObject);
begin
  with DMDados do
    begin
      cdsConsMateriais.Close;
      cdsConsMateriais.Open;
      cdsAddMaterial.Close;
      cdsAddMaterial.Open;
      cdsAddMaterial.Append;
      cdsAddMaterialID_ORCAMEMTOS.AsInteger := StrToInt(frmOrcamentos.Edit1.Text);
      cdsAddMaterialCOD_LAUDO_TECNICO.AsInteger := StrToInt(frmOrcamentos.Edit2.text);
    end;
end;

end.
